 package lesson15;

public class DemoExercise {

	public static void main(String[] args) 
	{
		
		ExerciseCar car = new ExerciseCar();
		printCar(car);

		
		ExerPerson person = new ExerPerson("dragan", "4234234242", true, 7001);
		
		ExerciseCar nissan = new ExerciseCar();
		ExerciseCar audi = new ExerciseCar();
		
		nissan = new ExerciseCar("Primera", "Grey", 6001, 198, 6, "Nissan");
		audi = new ExerciseCar("A4", "Black", 5000, 220, 6, "Audi");
		
		
		person.buyCar(nissan);
		System.out.println("person car " + person.car.brand);
		System.out.println("owner " + nissan.owner.name);
		
		
		System.out.print("Sell car - ");
		System.out.println(	person.sellCarForScrap());
		
		printCar(audi);
		printCar(nissan);
		
		System.out.println("More expensive? " + nissan.isMoreExpensive(audi));
		
		
		System.out.println(" === CalculateCarPriceForScrap ===");
		System.out.println(nissan.calculateCarPriceForScrap(0.37));
		System.out.println(audi.calculateCarPriceForScrap(0.37));
		
	}
	
	static void printCar (ExerciseCar car)
	{
		System.out.println("======== CAR INFO ========");
		System.out.println("    " + car.brand + "    ");
		System.out.println("Model: " + car.model);
		System.out.println("Color: " + car.color);
		System.out.println("Sport Car: " + car.isSportCar);
		System.out.println("Gear: "+ car.gear);
		System.out.println("Price: " + car.price);
		System.out.println();
	}
	
	
	

}
